#include "main.h"
#include "Taak.h"
#include "Parser.h"
#include <time.h>
#include "logger.hpp"
#include "tests\tests.h"

loglevel_enum loglevel = LOG_DEBUG;

int main(int argc, char** argv){
	

	//Google test
	loglevel = LOG_WARNING;
	freopen("gTest-log.txt", "a", stderr);

	runTests(argc,argv);

	loglevel = LOG_DEBUG;
	freopen("log.txt", "a", stderr);
	log(LOG_INFO) << "Program starting...";
	log(LOG_DEBUG) << "Starting program in Debug Mode";
	log(LOG_DEBUG) << "log redirected to log.txt";
	Taak taak;
	taak.initialize();
	
	
	const int BUFFER_SIZE = 1000;
	char* input = new char[BUFFER_SIZE];
	while(true){
		cout << ">>";
		cin.getline(input,BUFFER_SIZE,'\n');
		string output = taak.userInput(input);

		//Print output
		log(LOG_INFO) << output.c_str() << "\n";
	}
	
	return 0;
}